package me.xiaolei.andlog.prints.impls

import me.xiaolei.andlog.prints.Print
import java.io.PrintWriter
import java.io.StringWriter

/**
 * 输出异常信息堆栈的输出类
 */
class ThrowablePrint : Print<Throwable>
{
    override fun print(msg: Throwable): String
    {
        val writer = StringWriter()
        val printWriter = PrintWriter(writer)
        msg.printStackTrace(printWriter)
        return printWriter.toString()
    }
}